package com.jumper.study.admin.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jumper.study.admin.service.StudentStudyLogService;
import com.jumper.study.db.dao.StudentStudyLogMapper;
import com.jumper.study.db.dto.StudentStudyLogDto;
import com.jumper.study.db.dto.StudentStudyLogSearchDto;
import com.jumper.study.db.model.StudentStudyLog;

@Service
public class StudentStudyLogServiceImpl extends ServiceImpl<StudentStudyLogMapper, StudentStudyLog> implements StudentStudyLogService {

    @Override
    public IPage<StudentStudyLogDto> pageSearchWithAccountAndChapterByAccountAndLessonId(IPage<StudentStudyLogDto> page,
            Long accountId, Long lessonId) {
        StudentStudyLogSearchDto search = new StudentStudyLogSearchDto();
        search.setAccountId(accountId);
        search.setLessonId(lessonId);

        return getBaseMapper().pageSearchWithAccountAndChapter(page, search);
    }

    @Override
    public IPage<StudentStudyLogDto> pageSearchWithAccountAndChapterByLessonId(IPage<StudentStudyLogDto> page,
            Long lessonId) {
        StudentStudyLogSearchDto search = new StudentStudyLogSearchDto();
        search.setLessonId(lessonId);

        return getBaseMapper().pageSearchWithAccountAndChapter(page, search);
    }
    
}
